package cn.ihna.demo.algorithm.rbtree;

import java.util.Random;

/**
 * @author xianyingda@gmail.com
 * @serial
 * @since 2020-08-28 16:44
 */
public class RedBlackTree {
    public static void main(String[] args) {
        RBTree<Integer, Integer> rbTree = new RBTree<>();
        for (int i = 0; i < 4; i++) {
            rbTree.add(i, i + 100);
        }
        rbTree.print();
        Integer integer = rbTree.get(29);
        System.out.println("integer = " + integer);
    }

    public static void main0(String[] args) {
        RBTree<Integer, Integer> rbTree = new RBTree<>();
        Random random = new Random();
        for (int i = 0; i < 100; i++) {
            rbTree.add(random.nextInt(2000), 29);
        }
        rbTree.print();
        Integer integer = rbTree.get(29);
        System.out.println("integer = " + integer);
    }


}
